<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="keyword" content="">
    <title>工程管理系统——杭州筑信</title>

    <!-- Bootstrap core CSS -->
    <link href="/Public/css/bootstrap.min.css" rel="stylesheet">
    <link href="/Public/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="/Public/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom styles for this template -->
    <link href="/Public/css/style.css" rel="stylesheet">
    <link href="/Public/css/style-responsive.css" rel="stylesheet" />
    <!-- new styles-->
    <link href="/Public/css/xxxstyle.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="/Public/assets/bootstrap-datepicker/css/datepicker.css" />
    <link rel="stylesheet" type="text/css" href="/Public/assets/jquery-multi-select/css/multi-select.css" />
	  <link rel="icon" href="/Public/images/cropped-LOGO-32x32.png" sizes="32x32">
	  <link rel="icon" href="/Public/images/cropped-LOGO-180x180.png" sizes="180x180">

    <script type="text/javascript">
      //iframe
      function changeFrameHeight(){
          var ifm= document.getElementById("rightContent"); 
           ifm.height=document.documentElement.clientHeight;      
      }
      window.onresize=function(){  
           changeFrameHeight();  
      } 
    </script>
      <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
      <script src="/Public/js/html5shiv.js"></script>
      <script src="/Public/js/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>

  <section>
        <!--header start-->
      <header class="header white-bg">
            <div class="headerToggBtn">
              <!-- <div class="sidebar-toggle-box"><div data-original-title="点击收放" data-placement="right" class="icon-reorder tooltips"></div></div> -->
              <?php echo ($date["m"]); ?>月<?php echo ($date["d"]); ?>日 星期<?php echo ($arr[$date['w']]); ?>
            </div>
            <div class="headerLogoBox">
              <!--logo start-->
                <a class="logo"><img src="/Public/images/logo.png" /></a>
              <!--logo end-->
            </div>
            
            
            <div class="nav notify-row" id="top_menu">
                
            </div>
            <div class="top-nav">
                <!--search & user info start-->
                <ul class="nav pull-right top-menu">
                    <li class="dropdown dropdown-project">
                        <a data-toggle="dropdown" class="dropdown-toggle headerGreenBtn">
                          <i class="glyphicon glyphicon-align-justify"></i>                       
                            <?php if($_SESSION['pname'] != ''): ?><span class="username" id="swit"><?php echo ($admin_info["pname"]); ?></span>
                            <?php else: ?>
                                <span class="username">切换项目</span><?php endif; ?>
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu extended" style="top:50px;">
                            <div class="log-arrow-up"></div>
                            <?php if($project != '' && $project != 'null'): if(is_array($project)): foreach($project as $k=>$v): ?><li onclick="swit(<?php echo ($v["id"]); ?>,'<?php echo ($v["name"]); ?>')"><a href="#"><i class="icon-<?php echo $v['total_ren'] == $_SESSION['admin_id'] ? 'user' :'file';?>"></i><?php echo ($v["name"]); ?></a></li><?php endforeach; endif; ?>
                            <?php else: ?>
                                <li><a href="#"><i class="icon-file"></i>没有可切换的项目</a></li><?php endif; ?>
                        </ul>
                    </li>
                    <!-- user login dropdown start-->
                    <li class="dropdown">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <!-- <img style="float: left;" alt="" src="<?php echo ($img["img"]); ?>" width="29" height="29"> -->
                            <?php if($admin_info['role'] == 4 || $admin_info['role'] == 1): ?><i class="UserIcon UserIcon_1"><?php endif; ?>
                            <?php if($admin_info['role'] == 3): ?><i class="UserIcon UserIcon_2"><?php endif; ?>
                            <?php if($admin_info['role'] == 5): ?><i class="UserIcon UserIcon_3"><?php endif; ?>
                                 </i>
                            <span class="username BuildingCreditUsername">
                                <span><?php echo ($admin_info["name"]); ?></span>
                                <b class="caret"></b>
                            </span>                           
                        </a>
                        <ul class="dropdown-menu extended logout">
                            <div class="log-arrow-up"></div>
                            <li><a href="<?php echo U('/System/cleanCache');?>" onclick="return confirm('确定清除缓存吗？')"><i class=" icon-trash"></i>清除缓存</a></li>
                            <li><a href="<?php echo U('Admin/editpwd');?>" target="rightContent"><i class="icon-key"></i>修改密码</a></li>
                            <!-- <li><a href="<?php echo U('Admin/upload');?>" target="rightContent"><i class="icon-upload-alt"></i> 文件上传</a></li> -->
                            <li><a href="/Admin/logout"><i class="icon-power-off"></i>安全退出</a></li>
                        </ul>                  
                    </li>
                    <!-- user login dropdown end -->
                </ul>
                <!--search & user info end-->
            </div>
        </header>
      <!--header end-->
<script src="/Public/js/jquery.js"></script>
<script type="text/javascript" src="/Public/js/layer/layer.js"></script>
<script>
    //重点，每隔一段时间去服务器获取数据
    //window.setInterval("getMsg()",30000);
  function getMsg(){
    ajaxmes();
  }  
  $(document).ready(function(){
    ajaxmes();
  });
	// ajax 抓取页面
	function ajaxmes(){
    $.ajax({
        type : "POST",
        url:'/Index/ajaxmes',
        success: function(data){
        	if(data.status==0){
						layer.alert(data.info, {icon: 2});
						return;
					}
          $("#top_menu").html('');
          $("#top_menu").append(data);
        }
    });
	}    
  function deta(o){
	   var bb = $("#msg").text() - 1;
			  if(bb<=0){
				  bb="";
			  }
			  $("#msg").text(bb);
		$(o).remove();
  }
  function swit(obj,name){
	// var url = parent.document.getElementById("rightContent").contentWindow.location.href;
	  if(obj){
			layer.confirm('确定更换'+ name +'项目吗?', {
	     		btn: ['确定','取消'] //按钮
	    }, function(){
   			$.ajax({
   	          type : "POST",
   	          url:'/Home/Index/swit',
   	          data : {pid:obj,name:name},
   	          dataType : 'json',
   	          success: function(res){
   	        	  if(res.status==0){
       						  layer.alert(res.info, {icon: 2});
       						  return;
       				  }
       		 			  if(!res.errNo){
         		 				  layer.msg('切换成功',{icon:1});
         		 				  $('#swit').text(res.msg);
         		 			　　rightContent.location.reload();        
         			    }else{
         			        layer.msg(res.msg,{icon:1});
       			      }
   	          }
     	  });
	    }, function(){
	    			// 取消
	    });
	    return false;
	  }
  }
</script>

       
      <!--sidebar start-->
		      <aside>
          <div id="sidebar"  class="nav-collapse ">
              <!-- sidebar menu start-->
              <ul class="sidebar-menu">
                  <li style="margin-right: 70px;">
                      <a class="active" href="index.html">
                          <i class="icon-home"></i>
                          <span>我的主页</span>
                      </a>
                  </li>
              <?php if(is_array($menu_list)): foreach($menu_list as $k=>$vo): if(!empty($vo["sub_menu"])): ?><li class="sub-menu">
                          <a href="javascript:;" class="">
                              <i class="icon-<?php echo ($vo["icon"]); ?>"></i>
                              <span><?php echo ($vo["name"]); ?></span>
                            
                          </a>
                          <ul class="sub">
                          <!-- 	<li class="sub-menu">
                                  <a href="javascript:;" class="active">
                                      <span>基础文件</span>
                                  </a>
                                  <ul class="sub">
                                      <li class="active"><a class="" href="#">政府批复</a></li>
                                      <li><a class="" href="#">模型文件</a></li>
                                  </ul>
                              </li>  -->                   
                           <?php if(is_array($vo["sub_menu"])): foreach($vo["sub_menu"] as $kk=>$vv): ?><li onclick="makecss(this)" data-id="<?php echo ($vv["act"]); ?>_<?php echo ($vv["control"]); ?>"><a  class="" href="<?php echo U("$vv[control]/$vv[act]");?>" target='rightContent'><span><?php echo ($vv["name"]); ?></span></a>
                                  <?php if($vv['san'] != ''): ?><ul class="sub">
                                      <?php if(is_array($vv["san"])): foreach($vv["san"] as $kkk=>$vvv): ?><li><a class="" href="<?php echo U("$vvv[control]/$vvv[act]");?>" target='rightContent'><span><?php echo ($vvv["name"]); ?></span></a></li><?php endforeach; endif; ?> 
                                  </ul><?php endif; ?>
                              </li><?php endforeach; endif; ?> 
                          </ul>
                      </li><?php endif; endforeach; endif; ?>     
              </ul>
              <!-- sidebar menu end-->
          </div>
      </aside>
      
<script>
var tmpmenu = 'index_Index';
function makecss(obj){
	$('li[data-id="'+tmpmenu+'"]').removeClass('active');
	$(obj).addClass('active');
	tmpmenu = $(obj).attr('data-id');
}
</script>
      <!--sidebar end-->
      <!--main content start-->
      <section class="content-wrapper right-side" id="riframe">
               <iframe id='rightContent' name='rightContent' src="<?php echo U('Index/dataStatis');?>" width='100%' scrolling="no"  frameborder="0" onload="changeFrameHeight()"></iframe>
      </section>
      <!--main content end-->
  </section>

    <!-- js placed at the end of the document so the pages load faster -->
    <script src="/Public/js/jquery.js"></script>
    <script src="/Public/js/jquery-1.8.3.min.js"></script>
    <script src="/Public/js/bootstrap.min.js"></script>
    <script class="include" type="text/javascript" src="/Public/js/jquery.dcjqaccordion.2.7.js"></script>
    <script src="/Public/js/jquery.scrollTo.min.js"></script>
    <script src="/Public/js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="/Public/js/jquery.customSelect.min.js" ></script>

    <!--common script for all pages-->
    <script src="/Public/js/common-scripts.js"></script>

    <!--script for this page-->

      <!--new script for this page only-->
      <script type="text/javascript" src="/Public/assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
      <!---->
      <script type="text/javascript" src="/Public/assets/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
      <script type="text/javascript" src="/Public/assets/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>
      <script type="text/javascript" src="/Public/assets/bootstrap-timepicker/js/bootstrap-timepicker.js"></script>
      <script type="text/javascript" src="/Public/assets/jquery-multi-select/js/jquery.multi-select.js"></script>
      <script type="text/javascript" src="/Public/assets/jquery-multi-select/js/jquery.quicksearch.js"></script>
      <!---->
   <!--  <script src="/Public/js/advanced-form-components.js"></script>
    <script src="/Public/js/form-component.js"></script> -->
	
  <script>
      //custom select box
      $(function(){
          $('select.styled').customSelect();
      });
  </script>
  </body>
</html>